﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowStu.aspx.cs" Inherits="Demo.Show" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>学生成绩表</title>
    <style type="text/css">
        .auto-style1 {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
        <table class="auto-style1">
            <tr>
                <td>学生成绩表</td>
            </tr>
            <tr>
                <td>
    
        <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="475px" AutoGenerateColumns="False" DataKeyNames="StudentID" DataSourceID="SqlDataSource"  >
            <Columns>
                <asp:BoundField DataField="StudentID" HeaderText="StudentID" InsertVisible="False" ReadOnly="True" SortExpression="StudentID" />
                <asp:BoundField DataField="SequenceNumber" HeaderText="SequenceNumber" SortExpression="SequenceNumber" />
                <asp:BoundField DataField="Number" HeaderText="Number" SortExpression="Number" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Class" HeaderText="Class" SortExpression="Class" />
                <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
                <asp:BoundField DataField="TeacherID" HeaderText="TeacherID" SortExpression="TeacherID" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <SortedAscendingCellStyle BackColor="#FEFCEB" />
            <SortedAscendingHeaderStyle BackColor="#AF0101" />
            <SortedDescendingCellStyle BackColor="#F6F0C0" />
            <SortedDescendingHeaderStyle BackColor="#7E0000" />
        </asp:GridView>
    
                    <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DataConnectionString3 %>" DeleteCommand="DELETE FROM [StudentList] WHERE [StudentID] = @StudentID" InsertCommand="INSERT INTO [StudentList] ([SequenceNumber], [Number], [Name], [Class], [Password], [TeacherID]) VALUES (@SequenceNumber, @Number, @Name, @Class, @Password, @TeacherID)" SelectCommand="SELECT * FROM [StudentList]" UpdateCommand="UPDATE [StudentList] SET [SequenceNumber] = @SequenceNumber, [Number] = @Number, [Name] = @Name, [Class] = @Class, [Password] = @Password, [TeacherID] = @TeacherID WHERE [StudentID] = @StudentID">
                        <DeleteParameters>
                            <asp:Parameter Name="StudentID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="SequenceNumber" Type="String" />
                            <asp:Parameter Name="Number" Type="String" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Class" Type="String" />
                            <asp:Parameter Name="Password" Type="String" />
                            <asp:Parameter Name="TeacherID" Type="Int32" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="SequenceNumber" Type="String" />
                            <asp:Parameter Name="Number" Type="String" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Class" Type="String" />
                            <asp:Parameter Name="Password" Type="String" />
                            <asp:Parameter Name="TeacherID" Type="Int32" />
                            <asp:Parameter Name="StudentID" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="添加" />
    
                </td>
                
            </tr>
            <tr>
                <td>
    
                    &nbsp;</td>
                
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
